package com.itheima.demo02.CopyFile;

import java.io.*;

public class Demo02CopyFile {
    public static void main(String[] args) throws IOException {
        long s = System.currentTimeMillis();
        BufferedInputStream bis = new BufferedInputStream(new FileInputStream("day09_IOAndProperties\\1.jpg"));
        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("day10_IO\\1.jpg"));
        /*int len = 0;
        while ((len = bis.read()) != -1) {
            bos.write(len);
        }*/
        byte[] bytes = new byte[1024];
        int len = 0;
        while ((len = bis.read(bytes)) != -1) {
            bos.write(bytes, 0, len);
        }
        bos.close();
        bis.close();
        long e = System.currentTimeMillis();
        System.out.println("耗时:" + (e - s) + "毫秒");
    }
}
